package com.tt.payee.enums;

/**
 * @author  zhaochongsen
 * @Description
 * @date  2020/5/18 10:24
 */

public enum PlatformEnum implements BaseEnum {
    PC(1, "pc端"),
    H5(2, "H5端"),
    WX_MINI_PROGRAM(3, "微信小程序端"),
    APP_ANDROID(4, "app安卓端"),
    APP_IOS(5, "app苹果端");
    private Integer code;
    private String name;

    PlatformEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static String getName(int code) {
        for (PlatformEnum status : values()) {
            if (status.getCode().equals(code)) {
                return status.getName();
            }
        }
        return null;
    }

}
